#pragma once
#ifndef _KH_ENGINE_RENDERVIEW_H
#define _KH_ENGINE_RENDERVIEW_H
#include <Kharlia/Engine/Common.h>
#include <Kharlia/Engine/Units.h>
#include <CEGUIWindowFactory.h>

namespace kharlia { namespace engine {

class ACamera;

class FRenderView: public ui::Window {
    bool mDrawEveryFrame;
    shared_ptr<ACamera> mCamera;

public:
    FRenderView(const ui::String& type, const ui::String& name);

    // UI::Window interface
    void drawSelf(const ui::RenderingContext&);
    void onSized(ui::WindowEventArgs& e);

    void onMouseMove(ui::MouseEventArgs& e);
    void onMouseButtonUp(ui::MouseEventArgs& e);
    void onMouseButtonDown(ui::MouseEventArgs& e);
    void onKeyDown(ui::KeyEventArgs& e);
    void onKeyUp(ui::KeyEventArgs& e);

    inline bool GetDrawEveryFrame() const { return mDrawEveryFrame; }
    inline void SetDrawEveryFrame(bool value) { mDrawEveryFrame = value; }
    inline shared_ptr<ACamera> GetCamera() const { return mCamera; }
    inline void SetCamera(shared_ptr<ACamera> value) { mCamera = value; }

    static const ui::String WidgetTypeName;
    friend class CEngine;
};

}}

#endif